<template>
  <div class="walletBox" :style="outModuleCss">
    <div :style="moduleBgCss" class="module-bg"></div>
    <div class="walletContent">
      <div class="title" v-if="propsData.params.useTitle == 1">
        <moduleHeader
          :propsData="propsData"
          moreText="进入钱包"
          :moduleName="propsData.params.text"
          @editModuleHeader="editModuleHeader"
        ></moduleHeader>
      </div>
      <div class="walletList">
        <div
          class="walletItem"
          v-for="(item, index) in propsData.params.list"
          :key="index"
          @click.stop="chooseItem(item)"
        >
          <span class="count" v-if="index == 0">20</span>
          <span class="count" v-if="index == 1">1</span>
          <div class="count" v-if="index == 2">
            <span>60.00</span>
            <span>元</span>
          </div>
          <div class="count" v-if="index == 3">
            <span>20.00</span>
            <span>元</span>
          </div>
          <span class="name" :style="{ color: item.color }">{{ item.name }}</span>
          <span class="sub" :style="{ color: item.subColor }">{{ item.subName }}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { mixinsModuleCss } from '@/components/DiyNew/diy/mixins/index.js'
import moduleHeader from '@/components/DiyNew/diy/baseControl/moduleHeader/index.vue'
export default {
  name: 'userTools',
  props: {
    propsData: {
      type: Object,
      default: {},
    },
  },
  mixins: [mixinsModuleCss],
  components: {
    moduleHeader,
  },
  data() {
    return {}
  },
  methods: {
    editModuleHeader(e) {
      this.$emit('chooseMoudle', e)
    },
    chooseItem(e) {
      this.$emit('chooseMoudle', e)
    },
  },
}
</script>

<style lang="scss" scoped>
.walletBox {
  width: 100%;
  position: relative;
  .module-bg {
    width: 100%;
    height: 100%;
    z-index: -1;
    position: absolute;
    left: 0;
    top: 0;
  }
  .walletContent {
    width: 100%;
    padding: 12px;
    .title {
      padding-bottom: 11px;
      border-bottom: 1px solid #f1f1f1;
    }
    .walletList {
      display: flex;
      align-items: center;
      padding: 8px 8px 0 8px;
      justify-content: space-between;
      .walletItem {
        display: flex;
        flex-direction: column;
        position: relative;
        align-items: center;
        .count {
          display: flex;
          align-items: baseline;
          font-size: 19px;
          font-weight: 600;
          font-family: PingFang SC;
          margin-bottom: 5px;
          span:nth-child(2) {
            font-size: 9px;
            font-weight: 400;
          }
        }
        .name {
          font-size: 12px;
          font-family: PingFang SC;
        }
        .sub {
          font-size: 10px;
        }
      }
      .walletItem:hover::before {
        cursor: pointer;
        content: '\e657';
        font-family: 'iconfont';
        position: absolute;
        right: 0;
        top: 0;
        width: 20px;
        height: 20px;
        background-color: #1890fc;
        border-radius: 0 0 0 4px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        color: #fff;
      }
      .walletItem:hover::after {
        cursor: pointer;
        content: '';
        position: absolute;
        width: 100%;
        height: 100%;
        top: 0;
        left: 0;
        border: 1px solid #1890fc;
      }
    }
  }
}
</style>
